package com.example.work01;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
    private EditText edt_username;
    private EditText edt_name;
    private EditText edt_post;
    private EditText edt_phone;
    private EditText edt_pwd;
    private EditText edt_repwd;
    private String username;
    private String name;
    private String post;
    private String phone;
    private String pwd;
    private String repwd;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        edt_username=findViewById(R.id.edt_username);
        edt_name=findViewById(R.id.edt_name);
        edt_post=findViewById(R.id.edt_post);
        edt_phone=findViewById(R.id.edt_phone);
        edt_pwd=findViewById(R.id.edt_pwd);
        edt_repwd=findViewById(R.id.edt_repwd);
    }

    public void Get(View view) {
        username = edt_username.getText().toString();
        name = edt_name.getText().toString();
        post = edt_post.getText().toString();
        phone = edt_phone.getText().toString();
        pwd = edt_pwd.getText().toString();
        repwd = edt_repwd.getText().toString();
        Toast.makeText(this, "用户名："+username+" 真实姓名:"+name+" 邮箱："+post+" 电话："+phone+" 密码："+pwd, Toast.LENGTH_SHORT).show();
    }
}